package com.banyuan.HomeWork.string;

import java.util.Arrays;

//将字符串“abcdefg”倒序生成一个新的字符串；
public class six {
    public static void main(String[] args) {
        String s1 = "abcdefg";
        char[] c1 = s1.toCharArray();
        for (int i = 0; i < c1.length/2 ; i++) {
            char temp = c1[i];
            c1[i] = c1[c1.length - 1 -i];
            c1[c1.length - 1 -i] = temp;
        }
        String s2 =String.valueOf(c1);
        System.out.println(s2);
    }
}
